<%@page import="org.apache.catalina.connector.Request"%>
<%@page import="com.stx.crazyblog.entity.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>welcomePage</title>
</head>
<body>
	<div class = "container">
		<div id = "header">
			<div id ="title" >
				<h1>CrazyBlog欢迎界面</h1>
			</div>
		</div>
		<div id = "content">
			<fieldset>
				<%--从session中获取当前登录对象 --%>
				<%User currentUser = (User)session.getAttribute("currentUser"); %>
				<legend>
					<%if (currentUser != null){%>
						欢迎您，<%=currentUser.getUname() %>
						<a class="btn" href="<%=request.getContextPath()%>/jsp/loginout.jsp">退出</a>
						<%}else{ %>
						请登录：
						<a class="btn" href="<%=request.getContextPath()%>/jsp/login.jsp">重新登录</a>
					<%} %>
				</legend>
					<div>	
					<%if (currentUser !=null){ %>
					<a href="<%=request.getContextPath()%>/jsp/index.jsp"></a>
					<%} %>
					</div>
			</fieldset>
		</div>
	</div>

</body>
</html>